package com.lagou.edu.mvcframework.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public interface HandlerInterceptor {


    //进入方法前执行
    default boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {

        return true;
    }

    //执行方法逻辑，跳转之前执行
    default void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
    }

    //跳转之后执行
    default void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
                                  Exception ex) throws Exception {
    }
}
